<?php include('includes/before_html.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />

        <meta name="description" content="" />

        <meta name="keywords" content="" />

        <meta name="author" content="" />

        <?php include('includes/head.php'); ?>

        <title><?php echo $heading ?></title>

    </head>

    <body>

        <div id="wrapper">

            <?php include('includes/header.php'); ?>

            <?php include('includes/nav.php'); ?>

            <div id="content">
                <h3>Privacy Settings</h3></br>
                <form action="save_settings.php?t=privacy" method="post">
                    <table>
                        <?php
                        $db = mysql_connect(db_server, $db_user, $db_password);
                        mysql_select_db($db_dbname);

                        $result = mysql_query("describe Security");
                        $result2 = mysql_query("select * from Security where RUID=" . $myRuid);
                        $count = mysql_num_rows($result2);
                        $settings = mysql_fetch_array($result2);
                        $checked = 1;
                        while ($row = mysql_fetch_array($result)) {

                            if ($row['Field'] != 'RUID') {
                                if($count>0){
                                    $checked=$settings[$row['Field']];
                                }
                                else{
                                    $checked = 1;
                                }
                                
                                if($checked)
                                    $check = 'CHECKED';
                                else
                                    $check = '';
                                
                                echo '<tr>';
                                echo '<td>' . $row['Field'] . '</td><td><input type="checkbox" name="' . $row['Field'] . '" value="1" '.$check.' /></td>';
                                echo '</tr>';
                            }
                        }
                        ?>
                        <tr><td colspan="2"><input type="submit" name="Submit" value="Save"/></td></tr>
                    </table>
                </form>

            </div> <!-- end #content -->

            <?php include('includes/sidebar.php'); ?>

            <?php include('includes/footer.php'); ?>

        </div> <!-- End #wrapper -->

    </body>

</html>